package com.tianji.jd.data.utile;

/**
 * Description: new java files header..
 *
 * @author chenjia
 * @version 1.0
 * @date 2024/11/12 14:06
 */
public class DynamicDataSourceContextHolder {
    private static final ThreadLocal<String> contextHolder = new ThreadLocal<>();

    public static void setDataSourceKey(String key) {
        contextHolder.set(key);
    }

    public static String getDataSourceKey() {
        return contextHolder.get();
    }

    public static void clearDataSourceKey() {
        contextHolder.remove();
    }
}
